package ControlLayer;
import ModelLayer.Order;
import DBLayer.DBOrder;
import java.util.ArrayList;

public class CtrOrder {
    // <editor-fold defaultstate="collapsed" desc="Attributes & Constructors">
    private static CtrOrder instance = null;
    DBOrder dbOrder = new DBOrder();

    public CtrOrder() {
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Methods">
    public static CtrOrder getInstance() {
        if (instance == null) {
            instance = new CtrOrder();
        }
        return instance;
    }

    public ArrayList<Order> getOrderList() {
        return dbOrder.getOrderList();
    }

    public Order getOrderByID(int id) {
        return dbOrder.getOrderByID(id);
    }

    public int addOrder(Order order) {
        return dbOrder.addOrder(order);
    }

    public int updateOrder(Order order, int id) {
        return dbOrder.updateOrder(order, id);
    }

    public void deleteOrder(int id) {
        dbOrder.deleteOrder(id);
    }
    // </editor-fold>
}
